-- GENERATED SPELL FOR [Ortor of Murkblood] --


function spell0_18204(pUnit, Event) --@Corrupted Air Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32137,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18204', 1, 1)
end

function spell1_18204(pUnit, Event) --@Corrupted Healing Stream Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32135,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18204', 1, 1)
end

function spell2_18204(pUnit, Event) --@Tainted Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(32132,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18204', 10000, 1)
end

function spell3_18204(pUnit, Event) --@Tainted Earthgrab Totem,Self--
pUnit:FullCastSpellOnTarget(31981,pUnit)
pUnit:RegisterEvent('Sorts_18204', 30331, 1)
end

function Sorts_18204(pUnit, Event)
local choix_sorts_18204 = math.random(0, 3)
if choix_sorts_18204 == 0 then
pUnit:RegisterEvent('spell0_18204', 1, 1)
end
if choix_sorts_18204 == 1 then
pUnit:RegisterEvent('spell1_18204', 1, 1)
end
if choix_sorts_18204 == 2 then
pUnit:RegisterEvent('spell2_18204', 1, 1)
end
if choix_sorts_18204 == 3 then
pUnit:RegisterEvent('spell3_18204', 1, 1)
end
end

function mob18204_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18204', math.random(1500, 3000), 1)
end

function mob18204_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18204_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18204_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18204, 1, 'mob18204_Action')
RegisterUnitEvent(18204, 2, 'mob18204_Leave')
RegisterUnitEvent(18204, 3, 'mob18204_Kill')
RegisterUnitEvent(18204, 4, 'mob18204_Die')
